<!DOCTYPE html>
<html lang="en">
<head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>年终奖</title>
          <script>
                    function getAward(){
                              var year=prompt("输入工作年限（整数）:");
                              var salary=prompt("请输入月薪：");
                              var award;
                              switch (Number(year)){
                                        case 0:
                                                  if(salary>=8000){
                                                            award=salary*1.2;
                                                  }else{
                                                            award=salary*1;
                                                  }
                                                  break;
                                                  case 1:
                                                            if(salary>=10000){
                                                                      award=salary*1.7;
                                                            }else{
                                                                      award=salary*1.5;
                                                            }
                                                            break;
                                                            default:
                                                                      if(salary>=12000){
                                                                                award-salary*3.2;
                                                                      }else{
                                                                           award=salary*3;     
                                                                      }
                                                                      break;
                              }
                              alert("工作年限"+year+"年，月薪"+salary+"元，年终奖"+"元")
                    }
                    getAward();
          </script>
</head>
<body>
          
</body>
</html>